package pack0710.com;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class User {

    private String id ;

    private String name ;

    private String pass ;

    private List<Disk> borrows = new ArrayList<Disk>() ;   //借阅的影碟

    public User(){}

    public User(String id, String pass) {
        this.id = id ;
        this.pass = pass ;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public List<Disk> getBorrows() {
        return borrows;
    }

    public void setBorrows(List<Disk> borrows) {
        this.borrows = borrows;
    }

    @Override
    public boolean equals(Object o) {
        User user = (User) o;
        return id.equals(user.getId()) && pass.equals(user.getPass()) ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, pass, borrows);
    }
}
